package com.financing.platform.dao.impl;

import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IFpFileRecordDao;
import com.financing.platform.dto.FpFileRecordDTO;
import com.financing.platform.util.SqlName;
/**
 * fp_file_record  
 * 文件记录表 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpFileRecordDao")
public class FpFileRecordDaoImpl extends BaseDaoImpl implements IFpFileRecordDao {


	@Override
	public int insert(FpFileRecordDTO fpFileRecord) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.FpFileRecordSql.insert, fpFileRecord);
	}

	@Override
	public void update(FpFileRecordDTO fpFileRecord) throws SQLException {
		this.sqlMapClient.update(SqlName.FpFileRecordSql.update, fpFileRecord);
	}

	@Override
	public void updateForce(FpFileRecordDTO fpFileRecord) throws SQLException {
		this.sqlMapClient.update(SqlName.FpFileRecordSql.updateForce, fpFileRecord);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClient.delete(SqlName.FpFileRecordSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<FpFileRecordDTO> queryList(FpFileRecordDTO fpFileRecord) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.FpFileRecordSql.queryList, fpFileRecord);
	}

	@Override
	public int queryListCount(FpFileRecordDTO fpFileRecord) throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.FpFileRecordSql.queryListCount, fpFileRecord);
	}

	@Override
	public FpFileRecordDTO loadById(Integer id) throws SQLException {
		return  (FpFileRecordDTO)this.sqlMapClient.queryForObject(SqlName.FpFileRecordSql.loadById,id);
	}

}
